﻿@using NOSDC.Services.Extensions;

@model IEnumerable<NOSDC.Pocos.Events>
           
@section Title{
    @Html.CreatePageTitle("All Events")
}
@section MetaTags{ }

    <div class="newsPosting">
        <div>
            <div class="leftIcon"></div>
            <div class="titleWrapper">
                <div class="newsTitle">
                    All Events
                </div>
            </div>
        </div>
        <div class="rightIcon"></div>
    </div> 
    <div id="events">
@foreach (var item in Model)
{<div class="eventList">
        <div class="eventTitle"><img style="vertical-align:middle;" src="@Url.Content("~/Images/Logos/" + @item.Logo)" alt="" /> <span style="vertical-align: middle;">@Html.ActionLink(item.Title, "Index", "Events", new { item.EventID, Title = item.Title.ToSeoUrl() }, null)</span></div>
        <div class="eventDate">
            <span class="eventField">Date</span>: @item.StartDate.ToString("MMMM  d, yyyy hh:mm")</div>
        <div class="eventLocation">
            <span class="eventField">Location</span>: @item.Location</div>
        <div class="eventDescription">
            <span class="eventField">About the event</span><br />
            @item.Description.StripHTML().Truncate(500)
        </div>
        <div style="text-align: center;">@Html.ActionLink("View full event details", "Index", "Events", new { item.EventID, Title = item.Title.ToSeoUrl() }, null)</div>
    </div>
}
     </div>
@section Right
{
    @{Html.RenderAction("RecentJobs", "Jobs");}
    <br />
    <div class="newsPosting">
        <div>
            <div class="leftIcon"></div>
            <div class="upcomingEvents">
                <div class="newsTitle">
                    Search Events
                </div>
            </div>
        </div>
        <div class="rightIcon"></div>
    </div>

    <div id="eventCalendar" style="padding-top:10px;"></div>
    <br />
    <div style="text-align:center;">@Html.ActionLink("View upcoming event.", "Index", "Events")</div>
    <br />
}

@section JavaScript{
 <script src="@Url.Content("~/Scripts/jquery-ui.min.js")" type="text/javascript"></script>
    <script src="../../Scripts/UpcomingEvents.js" type="text/javascript"></script>
    <script type="text/javascript">
        $("#Events").addClass("selected");
        $("#eventCalendar").datepicker();
        $("#signUp").click(function () {
            eventSignup(Model.EventId);
        });
    </script>
}

@section CSS{
    <link href="../../Content/themes/redmond/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
}